unit KRK.Lib.Db.Consts;

{$WEAKPACKAGEUNIT ON}

interface

const
  PostGres_DefaultColumnValues =
  'SELECT ARD.adrelid'#13#10 +
  '     , ARD.adnum'#13#10 +
  '     , ARD.adbin'#13#10 +
  '     , pg_get_expr(ARD.adbin, ARD.adrelid) AS defaultvalue'#13#10 +
  '  FROM pg_attribute ATT'#13#10 +
  '  JOIN pg_attrdef ARD ON (ATT.attrelid = ARD.adrelid AND ATT.attnum = ARD.adnum)'#13#10 +
  ' WHERE ((:table IS NULL) OR (ATT.attrelid = CAST(:table AS regclass)))'#13#10 +
  '   AND ((:column IS NULL) OR (ATT.attname = :column))';


implementation

end.
